﻿<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
  <CustomAction Id="Ribbon.Library.Actions.Scripts"
              Location="ScriptLink"
              ScriptSrc="/_layouts/SPRA/OpenMyTask.js" />

  <!--<CustomAction Id="{0731cd6f-030d-41d4-9c3d-90dbb220a849}" Location="CommandUI.Ribbon.ListView" RegistrationId="100" RegistrationType="List" Sequence="100" xmlns="http://schemas.microsoft.com/sharepoint/">
    <CommandUIExtension xmlns="http://schemas.microsoft.com/sharepoint/">
      <CommandUIDefinitions>
        <CommandUIDefinition Location="Ribbon.ListItem.Actions.Controls._children">
          <Button Id="{4fee957c-dcac-452d-8eaa-311f907d38fd}"
                  Command="{b3a77bc2-4e5a-4c6c-90a3-f02ac992fbdf}"
                  Image32by32="/_layouts/Images/SPRA/OpenMyTask_32x32.png"
                  Image16by16="/_layouts/Images/SPRA/OpenMyTask_32x32.png"
                  Sequence="100"
                  LabelText="My Task"
                  Description="Redirect to my task"
                  TemplateAlias="o1" />
        </CommandUIDefinition>
      </CommandUIDefinitions>
      <CommandUIHandlers>
        <CommandUIHandler
          Command="{b3a77bc2-4e5a-4c6c-90a3-f02ac992fbdf}"
          CommandAction="javascript:SPRAOpenMyTask('{SiteUrl}','{ItemId}','{ListId}',escape(window.location));"
          EnabledScript="javascript:SPRAOpenMyTaskEnable();"/>
      </CommandUIHandlers>
    </CommandUIExtension>
  </CustomAction>-->

  <CustomAction Id="{0731cd6f-030d-41d4-9c3d-90dbb220a849}"
                Location="CommandUI.Ribbon.DisplayForm"
                RegistrationId="100"
                RegistrationType="List"
                xmlns="http://schemas.microsoft.com/sharepoint/">
    <CommandUIExtension xmlns="http://schemas.microsoft.com/sharepoint/">
      <CommandUIDefinitions>
        <CommandUIDefinition Location="Ribbon.ListForm.Display.Manage.Controls._children">
          <Button Id="{4fee957c-dcac-452d-8eaa-311f907d38fd}"
                  Command="{b3a77bc2-4e5a-4c6c-90a3-f02ac992fbdf}"
                  Image32by32="/_layouts/Images/SPRA/OpenMyTask_32x32.png"
                  Image16by16="/_layouts/Images/SPRA/OpenMyTask_32x32.png"
                  Sequence="11"
                  LabelText="My Task"
                  Description="Redirect to my task"
                  TemplateAlias="o1" />
        </CommandUIDefinition>
      </CommandUIDefinitions>
      <CommandUIHandlers>
        <CommandUIHandler
          Command="{b3a77bc2-4e5a-4c6c-90a3-f02ac992fbdf}"
          CommandAction="javascript:SPRAOpenMyTask('{SiteUrl}','{ItemId}','{ListId}','{Source}');" />
      </CommandUIHandlers>
    </CommandUIExtension>
  </CustomAction>
</Elements>
